package com.tuojian.nanjing.healthysystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuojian.nanjing.healthysystem.entity.CheckIn;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

public interface CheckInMapper extends BaseMapper<CheckIn> {
    // 自定义查询：查某用户某天是否已打卡
    @Select("SELECT * FROM check_ins WHERE user_id = #{userId} AND check_in_date = #{date}")
    CheckIn selectByUserIdAndDate(@Param("userId") Long userId, @Param("date") LocalDate date);

}
